<template>
    <div>
        <div class="section">
            <div class="book-list">
                <div class="header">
                    <div class="heading">最新更新</div>
                    <div class="more">更多...</div>
                </div>
                <div class="book-items">
                    <div class="book" v-for="book in books" >
                        <div @click="createevent" class="cover"><img :src="book.img_url"></div>
                        <div class="title">{{book.title}}</div>
                        <div class="authors">{{book.authors | join}}</div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</template>

<script type="text/ecmascript-6">
    import "./list.less"


    export default {
//        data() {
//            return {
//                books: [{img_url: require("./fixtures/covers/1.svg"), title: '揭开数据真相', authors: ['tim', 'liu']}
//                    , {img_url: require("./fixtures/covers/2.svg"), title: 'Android高级进阶', authors: ['大漠穷秋']}
//                    , {img_url: require("./fixtures/covers/3.svg"), title: '淘宝天猫运营', authors: ['唐晓君', '林子雨', '黄振虎']}
//                ]
//            }
//        },
        props:['books','heading'],

        methods:{
          createevent(){
              this.$emit('haha');
          }
        },
        filters: {
            join(args) {
                return args.join(',')
            }
        }


    }
</script>